<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue基础练习5</title>
    <style>
        .one{
            width: 100px;
            height: 100px;
            background-color: aqua;
        }
    </style>
</head>

<body>
    <div id="app">
        <button v-on:click="change">切换</button>
        <div :class="{one:isShow}"></div>
        <button v-on:click="add">增加</button>
        <div>{{num}}</div>
        <ul>
            <li v-for:="item in arr">{{item}}</li>
        </ul>
        <button v-on:click="push">插入</button>
    </div>
    <script src="./vue.global.js"></script>
    <script>
        const { createApp } = Vue;
        const app = createApp({
            data() {
                return {
                   isShow:true,
                   num:1,
                   arr:[1,2,3,4,5]
                }
            },
            methods:{
                change(){
                    this.isShow=!this.isShow;
                },
                add(){
                    this.num++;
                },
                push(){
                    this.arr.push(1);
                }
            }
        });
        app.mount('#app');
    </script>
</body>

</html>